package com.threadDemo;

public class Account {

    private String name;
    private float amount;
    private String bus;

    public  Account(String name,float amount,String bus){
        this.amount = amount;
        this.name = name;
        this.bus = bus;

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getAmount() {
        return amount;
    }

    public void setAmount(float amount) {
        this.amount = amount;
    }

    public String getBus() {
        return bus;
    }

    public void setBus(String bus) {
        this.bus = bus;
    }

    //存钱
    public void deposit(float amt){
        amount +=amt;

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

    //取钱


    public void withdraw(float amt){

        amount -=amt;

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public float getbalance(){

        return amount;
    }
}
